package com.googlecode.lightest.studio

/**
 * Validation constraints that are commonly used by domain objects and command
 * objects. Most functionality is provided as static methods, since constraints
 * are specified as static's anyway.
 *
 * @author chai
 */
class CommonConstraints {
	
    /**
     * Returns true if dir represents a valid directory path. The existence of
     * dir is NOT checked.
     * 
     * @param dir  the directory path to validate
     */
    static boolean dirOk(String dir) {
        try {
            new File(dir).getCanonicalPath()
        }
        catch (e) {
            return false
        }
        return true
    }
}

